﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <a href="http://javascriptissexy.com/javascript-variable-scope-and-hoisting-explained/">Variables in JS</a>
</head>
<body>
    <p>
        <strong>Local Variables (Function-level scope)</strong><br />
        Unlike most programming languages, JavaScript does not have block-level scope (variables scoped to surrounding curly brackets); instead, JavaScript has function-level scope. Variables declared within a function are local variables and are only accessible within that function or by functions inside that function.
    </p>
    <p>If you don't declare your local variables with the var keyword, they are part of the global scope</p>
    <div>
        <strong class="postSubheading">Global Variables</strong><br />
        All variables declared outside a function are in the global scope. In the browser, which is what we are concerned with as front-end developers, the global context or scope is the window object (or the entire HTML document).
    </div>
</body>
</html>
